import { useRequest } from 'ahooks';
import React from 'react';
import './index.less';
import { ConfigProvider, Button, theme, Dropdown, MenuProps, Popover } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import enUS from 'antd/locale/en_US';
import { ThemeData } from '../Layout';

interface HeaderProps {
  data: ThemeData
  onClickColor: (data: ThemeData) => void
}
const OneHeader = (props: HeaderProps) => {
  const { data, onClickColor } = props
  // const { run } = useRequest(telLoginCallback, {
  //   onSuccess: res => {
  //     console.log(res, 'res');
  //   },
  //   onError: err => {
  //     console.log(err, 'err');
  //   },
  // });
  // const handel = () => {
  //   run();
  // };
  return (
    <div className="one-header-warp">
      <div className="one-header-left">left</div>
      <div className="one-header-center">center</div>
      <div className="one-header-right">
        <div onClick={() => onClickColor({
            ...data,
            colorPrimary: '#ff4555'
          })}>自定义主题</div>
        {/* <Popover placement="bottomRight" title='定制主体颜色' trigger="hover">
          <div onClick={() => onClickColor({
            ...data,
            colorPrimary: '#ff4555'
          })}>自定义主题</div>
        </Popover> */}
      </div>
    </div>
  );
};

export default OneHeader;
